#!/bin/bash - 
#===============================================================================
#
#          FILE:  ex10-7.sh
# 
#         USAGE:  ./ex10-7.sh 
# 
#   DESCRIPTION:  Check some of the system's environmental variables
# 
#       OPTIONS:  ---
#  REQUIREMENTS:  ---
#          BUGS:  ---
#         NOTES:  ---
#        AUTHOR: bucunzai (), freecityer@gmail.com
#       COMPANY: FreeCity
#       CREATED: 2011年02月09日 14时41分32秒 CST
#      REVISION:  ---
#===============================================================================

set -o nounset                              # Treat unset variables as an error

#: ${HOSTNAME?} ${USER?} ${HOME?} ${MAIL?}
: ${HOSTNAME?} ${USER?} ${HOME?}
    echo
    echo "Name of the machine if $HOSTNAME"
    echo "You are $USER."
    echo "Your home directory is $HOME."
#    echo "Your mail Inbox is located in $MAIL."
    echo
    echo "If you are reading this message, critical environmental variables have been set."
    echo

# This ${variablename?} construction can also check for variables set within the script.
ThisVariable=Value-of-ThisVariable
: ${ThisVariable?}
echo "Value of ThisVariable is $ThisVariable."
echo; echo

#ZZXy='abc'
: ${ZZXy?"ZZXy has not been set."}

# You can specify the error message

echo "You will not see this message, because script already terminated."
HERE=0
exit $HERE


